package ModelLayer;

public class PartOrder
{
	private int partOrderID;
	private int amount;
	private double subTotal;
	private Product product;
	private int orderID;
	
	public PartOrder()
	{
		
	}
	
	public PartOrder(int partOrderID)
	{
		this.setPartOrderID(partOrderID);
	}
	
	public PartOrder(int amount, double subTotal, Product product, int orderID)
	{
		this.orderID = orderID;
		this.amount = amount;
		this.subTotal = subTotal;
		this.product = product;
	}
	
	public void setAmount(int newAmount)
	{
		amount = newAmount;
	}
	public void setSubTotal(double newSubTotal)
	{
		subTotal = newSubTotal;
	}
	public void setProduct(Product newProduct)
	{
		product = newProduct;
	}
	
	public void setOrderID(int newOrderID)
	{
		orderID = newOrderID;
	}
	
	public void setPartOrderID(int newPartOrderID) 
	{
		this.partOrderID = newPartOrderID;
	}
	
	public int getAmount()
	{
		return amount;
	}
	public double getSubTotal()
	{
		return subTotal;
	}
	public Product getProduct()
	{
		return product;
	}
	
	public int getOrderID()
	{
		return orderID;
	}
		
	public double calculateSaleSubTotal()
    {
        subTotal = amount * product.getSalesPrice();
        return subTotal;
    }
	public double calculateRentSubTotal()
    {
        subTotal = amount * product.getRentPrice();
        return subTotal;
    }
	
	public int getPartOrderID() {
		return partOrderID;
	}
}
